package com.qf.processor;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

//        BeanPostProcessor也称为Bean后置处理器，
//        它是Spring中定义的接口，在Spring容器的创建过程中（具体为Bean初始化前后）
//        会回调BeanPostProcessor中定义的两个方法

public class MyBeanPostProcessor implements BeanPostProcessor {
    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("后处理1");
        System.out.println("后处理1："+bean+" :"+beanName);
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("后处理2");
        System.out.println("后处理2："+bean+" :"+beanName);
        return bean;
    }
}
